package com.duothread;

public class PhoneTest {
    public static void main(String[] args) {
        PhoneFactory pf = new PhoneFactory();
        // 创建任务类
        ProduceTask produceTask = new ProduceTask(pf);
        CosumeTask cosumeTask = new CosumeTask(pf);
        // 创建线程类
        Thread thread1 = new Thread(produceTask);
        Thread thread2 = new Thread(cosumeTask);
        // 启动线程
        thread1.start();
        thread2.start();
    }
}
